<?php
define('TESTING', 1);
require_once 'index.php';

function test_above_directory() {
	return true;
}

function test_above_directory2() {
	return false;
}

function run_tests() {
	$aDefinedFunctions = get_defined_functions();
	$aDefinedFunctions = $aDefinedFunctions['user'];	
	print "<pre>\n"; 
	foreach ($aDefinedFunctions as $sFunctionName) {
		if (!preg_match('/^test/', $sFunctionName)) continue;
		print "Testing " . htmlentities(substr($sFunctionName, 4)) . "... ";
		if (call_user_func($sFunctionName)) {
			echo "<font color='green'>OK</font>\n";		
		}
		else {
			echo "<font color='red'>FAIL</font>\n";
		}
	}
}
run_tests();